package com.tuanzi.loan.business.entity.system;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Simon
 * @date 2019/08/08 16:02
 */
@Data
@Entity
@Table(name = "LOAN_ADS_CHANNEL_DETAIL")
@EqualsAndHashCode(callSuper = false)
public class Advertise implements Serializable {

    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Length(max = 20)
    @Column(name = "ACCOUNT_ID")
    private String accountId;

    @Length(max = 20)
    @Column(name = "ACCOUNT_PWD")
    private String accountpwd;

    @Length(max = 20)
    @Column(name = "CHANNEL_CODE")
    private String channel;

    @Length(max = 191)
    @Column(name = "ACCESS_TOKEN")
    private String accessToken;

    @Length(max = 191)
    @Column(name = "REFRESH_TOKEN")
    private String refreshToken;

    @Length(max = 50)
    @Column(name = "APP_ID")
    private String appId;

    @Length(max = 100)
    @Column(name = "APP_SECRET")
    private String appSecret;

    @Length(max = 50)
    @Column(name = "USER_ACTION_SET_ID")
    private String userActionSetId;

    @NotNull
    @Length(max = 20)
    @Column(name = "ACTION_TYPE")
    private String actionType;

    @NotNull
    @Column(name = "ADS_PLATFORM_TYPE")
    @Range(min = 0, max = Integer.MAX_VALUE)
    private Integer adsPlatformType;

    @NotNull
    @Length(max = 20)
    @Column(name = "EVENT_TYPE")
    private String eventType;
}
